# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=fgscanner
pkgver=11.893372c
pkgrel=6
groups=('blackarch' 'blackarch-scanner')
pkgdesc='An advanced, opensource URL scanner.'
arch=('any')
url='http://www.fantaghost.com/fgscanner'
license=('GPL3')
depends=('perl' 'perl-io-socket-portstate' 'perl-libwww' 'perl-getopt-long')
makedepends=('git')
source=("$pkgname::git+https://github.com/FantaGhost/FGscanner.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgnae

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" AUTHORS INSTALL README
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"

  rm AUTHORS INSTALL README COPYING

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/fgscan" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec perl fgscan.pl "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/fgscan"
}

